package service;

import Pojo.Userlist;
import dao.UserlistMapper;
import java.io.PrintStream;
import java.util.Iterator;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserlistServiceImpl
  implements UserlistService
{

  @Autowired
  private UserlistMapper userlistMapper;

  public Userlist findhasuserlist(Integer user_id)
  {
    Userlist userlist = this.userlistMapper.findhasuserlist(user_id);
    return userlist;
  }

  public Userlist checkuserlist(String idcard) {
    Userlist userlist = this.userlistMapper.checkuserlist(idcard);
    return userlist;
  }

  public void insertuserlist(Userlist userlist) {
    this.userlistMapper.insertuserlist(userlist);
  }

  public void updateuserlist(Userlist userlist)
  {
    this.userlistMapper.updateuserlist(userlist);
  }

  public Userlist finduserlistupdate(Userlist userlist)
  {
    Userlist list = this.userlistMapper.finduserlistupdate(userlist);
    return list;
  }

  public List<Userlist> getUserzuList(Integer id) {
    List userlist = this.userlistMapper.getUserzuList(id);
    for (Iterator localIterator = userlist.iterator(); localIterator.hasNext(); ) { Userlist list = (Userlist)localIterator.next();
      System.out.println(list);
    }
    return userlist;
  }

  public List<Userlist> getmycheckout(Integer id) {
    List list = this.userlistMapper.getmycheckout(id);
    return list;
  }

  public List<Userlist> getmyapply(Integer id) {
    List list = this.userlistMapper.getmyapply(id);
    return list;
  }

  public List<Userlist> getmyapplyout(Integer id) {
    List list = this.userlistMapper.getmyapplyout(id);
    return list;
  }

  public List<Userlist> findalluserlist() {
    List list = this.userlistMapper.findalluserlist();
    return list;
  }

  public void deleteuserlist(Integer id)
  {
    this.userlistMapper.deleteuserlist(id);
    this.userlistMapper.deleteuser(id);
  }
}